package demo2;

public class Test {
    public static <T extends Comparable<T>> T findMax(T[] array) {
        T max = array[0];
        for (int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i]) < 0) {
                max = array[i];
            }
        }
        return max;
    }
    public static void main(String[] args) {
        Integer[] integers = {1,2,33,65,7};
        Integer max = findMax(integers);
        System.out.println(max);
    }
}
